package com.shop.entity;

import java.io.Serializable;
import java.util.Objects;

//图片路径表
public class ImgPath implements Serializable {
    private int img_id;              //图片唯一id（主键，自增长)
    private String img_path;         //图片的路径
    private int gd_id;              //商品详情表id （外键)

    public ImgPath() {
    }

    public ImgPath(int img_id, String img_path, int gd_id) {
        this.img_id = img_id;
        this.img_path = img_path;
        this.gd_id = gd_id;
    }

    public int getImg_id() {
        return img_id;
    }

    public void setImg_id(int img_id) {
        this.img_id = img_id;
    }

    public String getImg_path() {
        return img_path;
    }

    public void setImg_path(String img_path) {
        this.img_path = img_path;
    }

    public int getGd_id() {
        return gd_id;
    }

    public void setGd_id(int gd_id) {
        this.gd_id = gd_id;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        ImgPath imgPath = (ImgPath) o;
        return img_id == imgPath.img_id &&
                gd_id == imgPath.gd_id &&
                Objects.equals(img_path, imgPath.img_path);
    }

    @Override
    public int hashCode() {
        return Objects.hash(img_id, img_path, gd_id);
    }

    @Override
    public String toString() {
        return "ImgPath{" +
                "img_id=" + img_id +
                ", img_path='" + img_path + '\'' +
                ", gd_id=" + gd_id +
                '}';
    }
}
